package com.tianhao.controller;

import com.tianhao.common.service.RestInterfaceInvokeService;
import com.tianhao.dto.ResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @author: tianhao.luo@hand-china.com 2021/6/22  下午1:37
 */
@RestController
@RequestMapping("/file")
public class FileUploadController {

    @Autowired
    private RestInterfaceInvokeService restInterfaceInvokeService;

    @PostMapping
    public ResultDTO<?> uploadFile(MultipartFile file,String assetNum,String loginName) throws Exception{
     return restInterfaceInvokeService.uploadFile(file, assetNum,loginName);
    }


    @PostMapping("/delete")
    public ResultDTO<?> deleteFile(String fileUrl,String assetNum,String loginName) throws Exception{
        return restInterfaceInvokeService.deleteFile(fileUrl, assetNum,loginName);
    }
}
